<!--{if $_G[uid]}-->
<el-dropdown trigger="click" @command="HeaderRightAvatar"  v-cloak>
	<div id="dzz_avatar_img">{eval echo avatar_block($_G[uid]);} </div>
	<el-dropdown-menu slot="dropdown" style="width: 165px;">
		<el-dropdown-item command="personal">个人设置</el-dropdown-item>
		<el-dropdown-item command="help">帮助文档</el-dropdown-item>
		<el-dropdown-item command="problem">问题反馈</el-dropdown-item>
		<!--{if $_G['adminid']==1}-->
		<el-divider></el-divider>
		<el-dropdown-item command="setting">站点设置</el-dropdown-item>
		<el-dropdown-item command="library">库设置</el-dropdown-item>
		<el-dropdown-item command="system">
			<span style="position: relative;">
				系统工具
				<!--{if $_G['setting']['upgrade']}-->
				<div class="tip" style="width: 7px;height: 7px;border-radius: 50%;background: red;position: absolute;left: -13px;top: 0;bottom: 0;margin: auto;"></div>
				<!--{/if}-->
			</span>
		</el-dropdown-item>
		<!--{/if}-->
		<el-divider></el-divider>
		<el-dropdown-item command="about">关于PicHome</el-dropdown-item>
		<el-dropdown-item command="OutLogin">退出站点</el-dropdown-item>
	</el-dropdown-menu>
</el-dropdown>
<!--{else}-->
<el-button type="primary" size="mini" @click="GoLogin">登录</el-button>
<!--{/if}-->
<script type="text/javascript">
	var JsHeaderRightAvatarMethods = {
		HeaderRightAvatar(type){
			var self = this;
			switch(type){
				case 'personal':
					window.location.href = MOD_URL + '&op=user&do=personal';
				break;
				case 'help':
					window.open('https://www.yuque.com/pichome');
				break;
				case 'problem':
					window.open('https://support.qq.com/products/340252');
				break;
				case 'setting':
					window.location.href = MOD_URL + '&op=admin&do=authorize';
				break;
				case 'library':
					window.location.href = MOD_URL + '&op=library';
				break;
				case 'about':
					this.$alert(
					`<div class="aboutlogo">
						<img src="`+MOD_PATH+`/image/phlogo.png" alt="">
					</div>
					<div class="aboutmessage">
						<div class="aboutlist">
							<span class="title">软件名称：</span><span class="mes">欧奥PicHome</span>
						</div>
						<div class="aboutlist">
							<span class="title">版本信息：</span><span class="mes">$_G[setting][version]</span>
						</div>
						<div class="aboutlist">
							<span class="title">版权信息：</span><span class="mes">Powered By oaooa PicHome © 2020-2022 欧奥图文</span>
						</div>
						<div class="aboutlist">
							<span class="title">网站地址：</span><span class="mes"><a class="address" href="https://oaooa.com/" target="_blank">oaooa.com</a></span>
						</div>
					</div>`,
					'',
					{
						customClass:'aboutPichome',
						showClose:false,
						showConfirmButton:false,
						dangerouslyUseHTMLString: true,
						closeOnClickModal:true
					});
				break;
				case 'OutLogin':
					self.$confirm('您确定要注销登录?', '提示', {
						  confirmButtonText: '确定',
						  cancelButtonText: '取消',
						  type: 'warning'
						}).then(function() {
						 jQuery.get('user.php?mod=login&op=logging&action=logout&formhash={FORMHASH}&t='+new Date().getTime(),function(data){
								window.location.reload();
							});
						}).catch(function() {
								   
						});
				break;
				case 'system':
					window.open(SITEURL+'admin.php?mod=system');
				break;
			}
			return false;
		},
		GoLogin(){
			window.location.href = SITEURL+'user.php?mod=login';
		},
	};
</script>